home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software 2000
/
Software 2000 Volume 1 (Disc 1 of 2).iso
/
utilities
/
u267.dms
/
u267.adf
/
INC9110B.LZH
/
include
/
getopt.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-25
|
2KB
|
38 lines
/*
* getopt.h
* for Amiga/GCC/PDC Simon Wright (sjwright@cix) 25.4.91
*/
#ifndef __GETOPT_H__
#define __GETOPT_H__
/*
* may return an alpha (the option encountered), in which case global output
* variables are valid, '?', in which case an error of some sort has occurred,
* or EOF, when argv[optind] is the first actual argument.
*
* optstring governs the option processing. It contains letters, ':', or ';'.
* The letters indicate legal options. A letter not followed by ':' or ';'
* takes no arguments and may appear in a string of options (-abcd). A letter
* followed by ':' indicates that the option takes a mandatory argument, which
* may optionally be white-space-separated; the option must be the last of a
* string of options. A ';' indicates that the option's argument may be qualified.
* If a qualifier is present it is returned in optqual. '-a-foo' returns a
* qualifier '-', while '-a+foo' & '-a foo' return a qualifier of '+'.
* Options may be introduced by '-' (as usual) or '+'; whichever is used is
* returned in optsign.
*/
int getopt(int argc, char **argv, char *optstring);
/* global interface */
extern int opterr; /* !0 if errors to be remarked on */
extern int optind; /* on completion, argv[optind] is the first actual arg */
/* the following only valid if getopt() returned an alpha */
extern int optopt; /* the option letter */
extern char optsign; /* '-' or '+', introducer of option */
extern char optqual; /* '-' or '+' (default), for ';' options */
extern char *optarg; /* the argument, or NULL */
#endif /* __GETOPT_H__